package com.hejjon.core.bean;


import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: cs
 * @date: 2025-02-26 15:35:22
 * @since: 1.0
 */
@Data
public class TreeNode<K> {

    private K id;

    private String name;

    private String text;

    private K parentId;

    private List<TreeNode<K>> children;

    private Boolean disabled = false;

    public TreeNode() {
        this.children = new ArrayList<>();
    }

    public TreeNode(K id, K parentId) {
        this.id = id;
        this.parentId = parentId;
        this.children = new ArrayList<>();
    }



    public void addChild(TreeNode<K> child) {
        children.add(child);
    }


}
